-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(elements): avoid exception when window is undefined #23324
Conversation
You can preview 0b3d636 at https://pr23324-0b3d636.ngbuilds.io/. |
You can preview 62cfe82 at https://pr23324-62cfe82.ngbuilds.io/. |
You can preview 659b0b8 at https://pr23324-659b0b8.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no test? how will we ensure that this remains working over time? can you please add a test?
For tests - We need to run the Custom Elements test suite as Node tests. Which involves making the custom elements work on platform-server first. I will do that post-6.0. For now this change enables us to polyfill Domino at the app level to get custom elements working on the server. |
Detect server environment by checking `typeof window` and schedule render immediately instead of waiting for RAF. This does not make Angular Elements work on platform-server. This is just the first step.
You can preview 2b5cb64 at https://pr23324-2b5cb64.ngbuilds.io/. |
Fix verified with SSR example (at http://go/ce-ssr) |
Detect server environment by checking `typeof window` and schedule render immediately instead of waiting for RAF. This does not make Angular Elements work on platform-server. This is just the first step. PR Close angular#23324
Detect server environment by checking `typeof window` and schedule render immediately instead of waiting for RAF. This does not make Angular Elements work on platform-server. This is just the first step. PR Close angular#23324
Detect server environment by checking `typeof window` and schedule render immediately instead of waiting for RAF. This does not make Angular Elements work on platform-server. This is just the first step. PR Close angular#23324
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Detect server environment by checking
typeof window
and schedule render immediately instead of waiting for RAF.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Avoid
window is undefined
exception when running Angular Elements on platform-server.This doesn't make the Angular elements work on the server yet but just a first step.